package org.samith.web.servlet;

import java.io.IOException;

import javax.ejb.EJB;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.samith.dao.UserDao;
import org.samith.dao.UserProfileDao;

@SuppressWarnings("serial")
public class WelcomeServlet extends HttpServlet {
	
	@EJB
	UserDao userDao;
	
	@EJB
	UserProfileDao userProfileDao;
	
	public void init() throws ServletException {
		super.init();
	}

	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		ServletContext context = getServletConfig().getServletContext();
		System.out.println("=============== userProfileDao "+userProfileDao.list().size());
		context.getRequestDispatcher("/WelcomeUsers/welcome.jsp").forward(req, resp);
	}

	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doGet(req, resp);
	}
}
